<template>
  <div class="echart-series-markLineArea">
    <el-tabs v-model="activeTab">
      <el-tab-pane
        v-if="hasProp('markLine')"
        :label="$demoi18n('echart.tab.referenceLine')"
        name="markLine"
      >
        <MarkLine
          ref="markLine"
          :form="form"
        />
      </el-tab-pane>
      <el-tab-pane
        v-if="hasProp('markArea')"
        ref="markArea"
        :label="$demoi18n('echart.tab.referenceArea')"
        name="markArea"
      >
        <MarkArea :form="form" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import MarkLine from './markLine.vue';
import MarkArea from './markArea.vue';
import echartUtil from '@/components/common/echart/echart-util.js';
import EchartCommonMixin from '@/components/common/echart/mixins/echart-common-mixin.js';

export default {
  components: { MarkLine, MarkArea },
  mixins: [EchartCommonMixin],
  props: {
    form: Object,
    curInfo: Object,
  },
  data() {
    return {
      activeTab: 'markLine',
      isInited: false,
    };
  },
  computed: {},
  watch: {
    activeTab(newVal) {
      this.curInfo.activeTab = newVal;
    },
  },
  created() {
    this.initActiveTab();
  },
  methods: {
    initActiveTab() {
      this.activeTab = this.curInfo.activeTab || 'markLine';
    },
  },
};
</script>
<style lang="less" scoped></style>
